-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Ghost context provider #3506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Ghost context provider #3506
Conversation
…nd recentlyEdited
|
markijbema
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect there to be code to register/deregister the ContextRetrievalService. So either it does it itself, but in that case there is some missing teardown code, or it doesnt, in which case it will always give an empty result.
Either way, even with that this does look way simpler than expected! Very cool
…g/kilocode into beatlevic/ghost-context-provider
src/services/ghost/classic-auto-complete/GhostContextProvider.ts
Outdated
Show resolved
Hide resolved
src/services/ghost/classic-auto-complete/GhostContextProvider.ts
Outdated
Show resolved
Hide resolved
| const filepathUri = filepath.startsWith("file://") ? filepath : vscode.Uri.file(filepath).toString() | ||
|
|
||
| // Initialize import definitions cache | ||
| await this.contextService.initializeForFile(filepathUri) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesnt seem thread safe; we can have multiple requests in flight, and then we initialize it for one file but by the time we create the snippetPayload it might have already been changed to another file
src/services/ghost/classic-auto-complete/GhostContextProvider.ts
Outdated
Show resolved
Hide resolved
| // Convert all snippet filepaths to URIs | ||
| const snippetsWithUris = filteredSnippets.map((snippet: any) => ({ | ||
| ...snippet, | ||
| filepath: snippet.filepath?.startsWith("file://") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, why do we have this in two different formats; is this a real thing or just llm slop?
Added ghost context provider that retrieves all relevant context in a comment wrapped style.
Adds the comment wrapped code to the QUERY prompt.